Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added conditional in testUniqueness to check parentNode exists #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jasan-s
Copy link

@jasan-s jasan-s commented Jun 30, 2019

added conditional in testUniqueness to check parentNode exists before calling querySelectorAll.

reason for fix: using it in react with "click" event listener. a element was removed on its own click caused error.

@omergulen
Copy link

How does this PR fixes the problem? What should I expect it to return when parentElement is removed from the DOM?

@jasan-s
Copy link
Author

jasan-s commented Aug 5, 2019

@omergulen it fixes the problem of error being thrown that caused App crash. Pre this PR if element no longer exists in DOM , exception was being thrown. It doesn't return a unique selector because it no longer exists in the DOM.

@omergulen
Copy link

How do you think I can work around this problem? I mean, I need to get a selector from the DOM before it is removed, is there any way to achieve it?

@jasan-s jasan-s force-pushed the bugfix/querySelectorAll_call_on_null_parentNode branch from 33cf2bc to 3dfc734 Compare August 20, 2019 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants